{% macro gen_table(stats, today_data) %}
    <table id="user-info-table" class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th colspan="2" bgcolor="#f4f4f4">基本信息</th>
                <th colspan="2">项目发布次数</th>
                <th colspan="2" bgcolor="#f4f4f4">抢单相关</th>
                <th colspan="3">汇币相关</th>                
                <th colspan="3" bgcolor="#f4f4f4">付费相关</th>
                <th colspan="2">代金券相关</th>
            </tr>
            <tr>
                <th>ID</th>
                <th>日期</th>
                <th>RO数</th>
                <th>发布次数</th>
                <th>抢单次数</th>
                <th>抢单人数</th>
                <th>抢单</th>
                <th>其他</th>
                <th>退返</th>
                <th>付费用户数</th>
                <th>付费单数</th>
                <th>付费金额</th>
                <th>消耗券额</th>
                <th>抵扣券额</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>-</td>
                <td>{{ today_data['stat_date'] }}</td>
                <td>{{ today_data['ro_cnt'] }}</td>
                <td>{{ today_data['publish_count'] or 0 }}</td>
                <td>{{ today_data['bid_cnt'] }}</td>
                <td>{{ today_data['bid_people_cnt'] }}</td>
                <td>{{ today_data['day_cost_bid_point'] }}</td>
                <td>{{ today_data['day_cost_bid_point_other'] }}</td>
                <td>{{ today_data['day_return_bid_point'] }}</td>
                <td>{{ today_data['pay_people_cnt'] }}</td>
                <td>{{ today_data['pay_cnt'] }}</td>
                <td>{{ today_data['pay_amt'] }}</td>
                <td>{{ today_data['voucher_bid_point'] }}</td>
                <td>{{ today_data['used_voucher_bid_point'] }}</td>
            </tr>
            {% for stat in stats %}
            <tr>
                <td>{{ stat.id }}</td>
                <td>{{ stat.stat_date }}</td>
                <td>{{ stat.ro_cnt }}</td>
                <td>{{ stat.publish_count }}</td>
                <td>{{ stat.bid_cnt }}</td>
                <td>{{ stat.bid_people_cnt }}</td>
                <td>{{ stat.day_cost_bid_point }}</td>
                <td>{{ stat.day_cost_bid_point_other }}</td>
                <td>{{ stat.day_return_bid_point }}</td>
                <td>{{ stat.pay_people_cnt }}</td>
                <td>{{ stat.pay_cnt }}</td>
                <td>{{ stat.pay_amt }}</td>
                <td>{{ stat.voucher_bid_point }}</td>
                <td>{{ stat.used_voucher_bid_point }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
{% endmacro %}
